import request from '@/utils/request'

export const selectRoleList = (data) => {
  return request({ url: '/sys/role', params: data })
}

export const addRole = (data) => {
  return request({ url: '/sys/role', method: 'post', data })
}

export const updateRole = (data) => {
  return request({ url: `/sys/role/${data.id}`, method: 'put', data })
}

export const getRoleDetail = (id) => {
  return request({ url: `/sys/role/${id}` })
}

export const delRole = (id) => {
  return request({ url: `/sys/role/${id}`, method: 'delete' })
}

export const assignPerm = (data) => {
  return request({ url: '/sys/role/assignPrem', method: 'put', data })
}
